<?php
require 'staticclass.php';

$klasID = 1; // @todo Set to actual current klasID
$klasGegevens = mysql_fetch_assoc(mysql_query("SELECT * FROM `klassen` WHERE `id`='" . $klasID . "'"));

$studentMngr = new StudentManagement($klasID);


// isset — Determine if a variable is set and is not NULL
if(isset($_GET['action']))
{
	if(isset($_GET['student']) && !ctype_digit($_GET['student']))
	{
		die("Illegal Student number");
	}
	
	switch($_GET['action'])
	{
		case 'add':
			echo $studentMngr->showAddForm();
			break;
		case 'edit':
			echo $studentMngr->showEditForm($_GET['student']);
			break;
		case 'delete':
			echo $studentMngr->showDeleteConfirmation($_GET['student']);
			break;
		default:
			echo $studentMngr->showList();
			break;
	}
}
else
{
	echo $studentMngr->showList();
}